<div id="left"></div>
<div id="new-post">
   <?= $this->newPostForm->render(); ?>
</div>

<table id="messages-table"> 
   <tr><td>
         <h1>User-infos</h1>
         <div id="user-infos">
            <h3>My messages</h3>
            <ul id="messages">
<?php
if (count($this->postsFromCurrentUser) > 0) {
   foreach ($this->postsFromCurrentUser as $post) {
      echo "<li>";
      echo "<h6>Posted on ".$post["date"]."</h6>";
      echo $post["text"];
      echo "</li>";
   }
}
else {
?>
               <em>You didn't post any message yet.</em>
<?php
}
?>
            </ul>
            
            <h3>My topics</h3>
            <ul id="topics">
<?php
if (count($this->topics) > 0) {
   foreach ($this->topics as $topic) {
      echo "<li>";
      echo "<a href=\"/WhatsUpProject/public/search/user?avatar=".
              $topic["userName"]."\">".$topic["userName"]."</a>";
      echo "</li>";
   }
}
else {
?>
               <em>You didn't subscribe to any topic yet. <br>
               <a href="/WhatsUpProject/public/search/">Search for topics?</a></em>
<?php
}
?>
            </ul>
            
            <h3>My subscribers</h3>
            <ul id="subscribers">
<?php
if (count($this->subscribers) > 0) {
   foreach ($this->subscribers as $subscriber) {
      echo "<li>";
      echo "<a href=\"/WhatsUpProject/public/search/user?avatar=".
              $subscriber["userName"]."\">".$subscriber["userName"]."</a>";
      echo "</li>";
   }
}
else {
?>
               <em>No one is following you yet.</em>
<?php
}
?>
            </ul>
            
         </div>
      
      </td><td>
         
         <h1>News from my topics</h1>
         <ul id="news">
<?php
if (count($this->postsFromTopics) > 0) {
   foreach ($this->postsFromTopics as $message) {
      echo "<li>";
      echo "<h6>Posted by ".$message["author"]." on ".$message["date"]."</h6>";
      echo $message["text"];
      echo "</li>";
   }
}
else {
?>
            <em>No news from your topics yet...</em>
<?php
}
?>
         </ul>
      
      </td></tr>

</table>
